#ifndef DEVICEMANAGER_H
#define DEVICEMANAGER_H
#include <QtGui>
#include <QtGlobal>
#include <qtopia/qtopiaapplication.h>
#include <QTextStream>
#include <QFile>

class DeviceManager : public QThread
{
    Q_OBJECT

    public:
		DeviceManager(QString devicePath, int id);
		~DeviceManager();
		void setPattern(QList<int> pattern);
		void run();
		void stop();
		

    private:
		QTimer *timer;
		QString devicePath;
		QList<int> pattern;		
		int index;			// index of pattern
		int id;

		void vibrate(int strength);	

	signals:
		void terminateSignal(); //emit when finish playing pattern
		void vibrationSignal(bool pos, int id);

	private slots:
		void move();

};

#endif

